<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class BlindBoxOrderResource extends JsonResource
{
	public function toArray($request)
	{
		$resource = $this->resource;
		
		return [
			'id'                        => (int)$resource->id,
			'user_id'                   => (int)$resource->user_id,
			'product_id'                => $resource->product_id ?? '',
			'sku_id'                    => $resource->sku_id,
			'box_price'             	=> $resource->box_price,
			'paid_at'					=> $resource->paid_at,
			
			'user'                      => new UserResource($this->user),
		];
	}
}
